<template>
    <div class="newsinfo-content">
        <!-- <h3>这是新闻详情---------{{id}}</h3> -->
        <h3 class="title">{{infoList.title}}</h3>
        <div class="substr">
            <span>发表时间:{{infoList.add_time |dataFormat}}</span>
           <span>点击{{infoList.click}}次</span>
        </div>

<hr>
    <p v-html="infoList.content"></p>


    <comment-box :id="this.id"></comment-box>
    </div>
</template>

<script>
import comment from '../subcoment/comment.vue'

import {Toast} from 'mint-ui'

export default {
     data() {
         return {
             id:this.$route.params.id,
             infoList:[]
         }
     },
     created() {
         this.getListinfo()
     },    
     methods: {
         getListinfo(){
             this.$http.get('http://www.liulongbin.top:3005/api/getnew/'+this.id).then(result=>{
                 if(result.body.status==0){
                    //  成功
                    this.infoList=result.body.message[0]
                 }else{
                    //  失败
                    Toast("获取数据失败")
                 }
             })
         }
     },
     components:{
         'comment-box':comment
     }
}
</script>
<style lang="scss" scoped>
    .newsinfo-content{
        padding: 0 4px;
        .title{
            margin:10px 0;
            text-align: center;
            color: red;
            font-size: 16px;
        }
        .substr{
            display: flex;
            font-size: 14px;
            color:#226aff;
            justify-content: space-between
        }
    }


</style>
